import axios from './axios'

/**
 * 列表
 * @param {
 * account,current,phone,size,status,username
 * } data 
 * @returns 
 */
export const list = (data) => {
  return axios.post('system-user/page', data)
}

/**
 * 新增
 * @param {account,phone,roleId,sex,status,username} data 
 * @returns 
 */

export const add = (data) => {
  return axios.post('system-user', data)
}

/**
 * 修改
 * @param {id,account,phone,roleId,sex,status,username} data 
 * @returns 
 */

export const update = (data) => {
  return axios.post('system-user/update', data)
}


/**
 * 删除
 * @param {id} data 
 * @returns 
 */

export const del = (id) => {
  return axios.post(`system-user/delete/${id}`)
}

/**
 * 
 * @param {*} data 
 * @returns 
 */

export const get = (id) => {
  return axios.get(`system-user/${id}`)
}
/**
 * 修改密码
 * @param {id:number;newPassword: string;oldPassword: string;} data 
 * @returns 
 */

export const updatepwd = (data) => {
  return axios.post('system-user/password', data)
}
/**
 * 重置密码
 * @param {id} data 
 * @returns 
 */

export const reset = (data) => {
  return axios.get('system-user/reset-password/' + data)
}